//simple one
import { print } from 'graphql/language/printer';
import {
  postFetch,
} from '../../util/httpHelper';
export default function createNetworkInterface({uri,getToken}){
  return {
    query(request){
      const textBody = JSON.stringify({
        ...request,
        query:print(request.query),
        token:getToken(),
      })
      return postFetch(uri)(textBody).then(response=> response.json())
    },
  }
}
